set more off
use MainFile_PR 

local xcontrol1 Age AgeSq YearsEd Muslim BirthOrder
local xcontrol2 MoAlFstMarr FaAlFstMarr BroAtMarr SisAtMarr MoEverAttd FaEverAttd LParFarmland ParFarmlandMissing
local xcontrol3 RainDevYearWom11 RainDevYearWom12 RainDevYearWom13
local conditions "Female==1 & Age~=. & AgeSq~=. & YearsEd~=. & Muslim~=. & MoAlFstMarr~=. & FaAlFstMarr~=. & BroAtMarr~=. & SisAtMarr~=. & BirthOrder~=. & RainDevYearWom11~=. & RainDevYearWom12~=. & RainDevYearWom13~=. & MoEverAttd~=. & FaEverAttd~=. & MarrCousin~=. & LDowryVal~=. & FaAge~=."

areg  Dowry MarrCousin `xcontrol1' `xcontrol2' `xcontrol3' if `conditions',   absorb(YearMarrD5) cluster(bari_num)
est2vec Cousin, e(r2 F) replace vars(MarrCousin MarrRelative MarrVillage AgeMarried  YearsEd Muslim BirthOrder MoAlFstMarr FaAlFstMarr BroAtMarr SisAtMarr MoEverAttd FaEverAttd LParFarmland ParFarmlandMissing RainDevYearWom11 RainDevYearWom12 RainDevYearWom13)

rename Dowry Dowry1 
areg  Dowry1 MarrCousin MarrRelative `xcontrol1' `xcontrol2' if `conditions',   absorb(YearMarrD5) cluster(bari_num)
est2vec Cousin, addto(Cousin)

rename Dowry1 Dowry2 
areg  Dowry2 MarrCousin MarrRelative MarrVillage `xcontrol1' `xcontrol2' `xcontrol3' if `conditions',   absorb(YearMarrD5) cluster(bari_num)
est2vec Cousin, addto(Cousin)

/****** Cousin, dowry value *********************/ 

rename LDowryVal LDowryVal1 
areg  LDowryVal1 MarrCousin `xcontrol1' `xcontrol2' `xcontrol3' if `conditions',   absorb(YearMarrD5) cluster(bari_num)
est2vec Cousin, addto(Cousin)

rename LDowryVal1 LDowryVal2 
areg  LDowryVal2 MarrCousin MarrRelative `xcontrol1' `xcontrol2' `xcontrol3' if `conditions',   absorb(YearMarrD5) cluster(bari_num)
est2vec Cousin, addto(Cousin)

rename LDowryVal2 LDowryVal3 
areg LDowryVal3 MarrCousin MarrRelative MarrVillage `xcontrol1' `xcontrol2' `xcontrol3' if `conditions',   absorb(YearMarrD5) cluster(bari_num)
est2vec Cousin, addto(Cousin)

est2tex Cousin, replace dropall mark(stars) fancy digits(4) label

%

